<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link href="http://daisyun.oss.aliyuncs.com/js/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
	<link href="http://daisyun.oss.aliyuncs.com/js/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet">
    <title>Dict</title>
	<style type="text/css">
	    #main {
	        margin: 200px auto;
	        max-width: 500px;
	    }
		
	    .query {
	        width: 400px;
	    }
	</style>
    <script type="text/javascript">
        function play() {
            document.getElementById("audio").play();
        }
    </script>
</head>
<body>
    <div id="main">
        <form class="form-search" method='post'>
	        <input type="text" class="query" name='word' />
	        <button type="submit" class="btn">Search</button>
	    </form>
    {% if not word_name %}
    <p>注：发音可能存在延迟。</p>
    {% endif %}
	{% if word_name %}
        <span>{{ word_name }}</span>
        {% if worttrennung %}
        <span>({{ worttrennung }}</span>
        {% endif %}
        {% if betonung %}
        <span> {{ betonung }})</span>
        {% else %}
        {% if worttrennung %}
        <span>)</span>
        {% endif %}
        {% endif %}
        {% if audio_link %}
        <audio id="audio" src="{{ audio_link }}"></audio>
        <!-- Borrow code from http://www.duden.de -->
        <span>
            <object width="26" height="17" data="http://www.duden.de/sites/all/themes/dudende/mp3player/player_mp3_maxi.swf" type="application/x-shockwave-flash">
                <param value="mp3={{ audio_link }}&amp;configxml=http://www.duden.de/sites/all/themes/dudende/mp3player/config_player_mini.xml&amp;skin=http://www.duden.de/sites/all/themes/dudende/mp3player/audio.jpg" name="FlashVars">
                <a href="javascript:void(0);"><img src="http://www.duden.de/sites/all/themes/dudende/mp3player/audio.jpg" alt="" onclick="play();" /></a>
            </object>
        </span>
        <a href="{{ duden_link }}" target="_blank">去杜登</a> <a href="{{ audio_link }}" target="_blank">查看音频</a> 
	    {% else %}
            {% if duden_link %}
            <a href="{{ duden_link }}" target="_blank">去杜登</a>
            {% else %}
	        <span>没有找到该单词的发音</span>
            {% endif %}
        {% endif %}
	{% endif %}
    </div>
</body>
</html>
